x86/mm: Rework locking in the PoD layer
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>
Fri, 10 Feb 2012 16:07:07 +0000 (16:07 +0000)
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>
Fri, 10 Feb 2012 16:07:07 +0000 (16:07 +0000)
commit99af3cd40b6e9fde63daddcec86ee5e6db338d94
tree8f28367c9ad1f8b2585b4fd9241ce9d5f8ce54c1
parente1e40bccee7490a01ac7d1f759ec2bbafd3c7185
x86/mm: Rework locking in the PoD layer

The PoD layer has a complex locking discipline. It relies on the
p2m being globally locked, and it also relies on the page alloc
lock to protect some of its data structures. Replace this all by an
explicit pod lock: per p2m, order enforced.

Three consequences:
    - Critical sections in the pod code protected by the page alloc
      lock are now reduced to modifications of the domain page list.
    - When the p2m lock becomes fine-grained, there are no
      assumptions broken in the PoD layer.
    - The locking is easier to understand.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/mm-locks.h
xen/arch/x86/mm/p2m-pod.c
xen/arch/x86/mm/p2m-pt.c
xen/arch/x86/mm/p2m.c
xen/include/asm-x86/p2m.h